{% set pypi_name = 'python-senlinclient' %}
{% set upstream_version = upstream_version('2.2.0') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Python API and CLI for OpenStack Senlin
License:        {{ license('Apache-2.0')}}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('Babel') }}
BuildRequires:  {{ py3('PrettyTable') }}
BuildRequires:  {{ py3('PyYAML') }}
BuildRequires:  {{ py3('devel') }}
BuildRequires:  {{ py3('fixtures') }}
BuildRequires:  {{ py3('python-heatclient') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('python-openstackclient') }}
BuildRequires:  {{ py3('openstacksdk') }}
BuildRequires:  {{ py3('osc-lib') }}
BuildRequires:  {{ py3('oslo.i18n') }}
BuildRequires:  {{ py3('oslo.serialization') }}
BuildRequires:  {{ py3('oslo.utils') }}
BuildRequires:  {{ py3('oslotest') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('requests') }}
BuildRequires:  {{ py3('requests-mock') }}
BuildRequires:  {{ py3('stestr') }}
BuildArch:      noarch

%description
OpenStack Clustering service Provisioning API Client Library

This is a client for the OpenStack Senlin API.
It provides a Python API (the senlinclient module).

%package -n python3-senlinclient
Summary:        Python API and CLI for OpenStack Senlin
Requires:       {{ py3('Babel') }}
Requires:       {{ py3('PrettyTable') }}
Requires:       {{ py3('PyYAML') }}
Requires:       {{ py3('python-heatclient') }}
Requires:       {{ py3('keystoneauth1') }}
Requires:       {{ py3('python-openstackclient') }}
Requires:       {{ py3('openstacksdk') }}
Requires:       {{ py3('osc-lib') }}
Requires:       {{ py3('oslo.i18n') }}
Requires:       {{ py3('oslo.serialization') }}
Requires:       {{ py3('oslo.utils') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('requests') }}
Requires:       {{ py3('six') }}

%description -n python3-senlinclient
OpenStack Clustering service Provisioning API Client Library

This is a client for the OpenStack Senlin API.
It provides a Python API (the senlinclient module).

This package provides the Python 3.x module.

%package -n python-senlinclient-doc
Summary:        Documentation for OpenStack Senlin API Client
Group:          Documentation/HTML
BuildRequires:  {{ py3('Sphinx') }}
BuildRequires:  {{ py3('openstackdocstheme') }}
BuildRequires:  {{ py3('reno') }}

%description -n python-senlinclient-doc
This is a client for the OpenStack Senlin API.
It implements 100% of the OpenStack Senlin API. This package contains
auto-generated documentation.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup


%build
%{py3_build}

PBR_VERSION=%version %sphinx_build -b html doc/source doc/build/html
# remove the sphinx-build leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%{py3_install}

%check
python3 -m stestr.cli run

%files -n python3-senlinclient
%license LICENSE
%doc README.rst
%{python3_sitelib}/senlinclient
%{python3_sitelib}/*.egg-info

%files -n python-senlinclient-doc
%license LICENSE
%doc doc/build/html

%changelog
